<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="target-densitydpi=device-dpi, width=640px, user-scalable=no">
    <meta name="apple-themes-web-app-capable" content="yes">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection">
    <meta content="email=no" name="format-detection">
    <meta name="format-detection" content="telephone=no">
    <title>机构信息</title>
    <link rel="stylesheet" href="/static/index/css/main.css" type="text/css" media="all">
    <script src="http://res2.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
    <style type="text/css">
        .institutionContent {
            text-align: center;
            margin-top: 10px;
        }

        .card {
            background-color: white;
            margin-bottom: 20px;
            border-radius: 10px;
            padding: 10px;
            box-shadow: 2px 2px 10px #ccc;
        }

        .location {
            font-size: 22px;
            color: #999;
            text-align: center;
            width: 100%;
        }

        .goodClass {
            float: right;
            margin-right: 15px;
            background-color: #1F9532;
            width: 300px;
            text-align: center;
            color: white;
            border-radius: 9px;
            font-weight: 500;
        }

        .map {
            float: right;
            margin-right: 15px;
            background-color: #01A9EC;
            width: 100px;
            text-align: center;
            color: white;
            border-radius: 9px;
            font-weight: 500;
        }

        .insUrl{
            float: right;
            margin-right: 15px;
            background-color: #74817b;
            width: 100px;
            text-align: center;
            color: white;
            border-radius: 9px;
            font-weight: 500;
        }
        .articleContent img {
            width: 100%;
        }

        .imgDiv img {
            width: 100%;
            height: 100%;
        }


    </style>
</head>

<body>
<!--页面加载 开始-->
<div id="preloader">
    <div id="status">
        <p class="center-text"><span>拼命加载中···</span></p>
    </div>
</div>
<!--页面加载 结束-->

<div id="content_div">
    <div class="header">
<!--        <a href="javascript:history.go(-1);" class="fanhui"></a>-->
        <a href="javascript:window.history.go(-1) " class="fanhui"></a>
        机构详情
    </div>
    <div class="top_pic">
        <div class="carousel-image" id="scroll_img">
            <div class="imgDiv">
                {volist name="thumbList" id="vo"}
                <a href="#"><img src="{$vo}" class="img"/></a>
                {/volist}
            </div>
            <span class="carousel-num"></span>
        </div>


    </div>
    <div class="page" style="margin-left: 10px;    margin-right: 10px;width: 620px;">
        <div class="card">
            <div class="bt">{$institutionInfo['ins_name']}</div>
            <div class="location">所在城市：{$institutionInfo['bind_city']['cty_name']}</div>
        </div>
        <div class="card">
            <p>好课信息：<span class="goodClass" id="goodClass">点击查看机构课程信息</span></p>
        </div>
        <div class="card">
            <p>与我距离：{$juli}KM <span class="map" id="map">到这去</span></p>
        </div>
        {if $hasInsUrl}
        <div class="card">
            <p>机构官网地址 <span class="insUrl" id="insUrl">跳转</span></p>
        </div>
        {/if}
        {if $institutionInfo['ins_student_url']}
        <div class="card">
            <p>招生信息链接 <span class="insUrl" id="ins_student_url">跳转</span></p>
        </div>
        {/if}
        <div class="card articleContent" style="font-size: 20px">
            {if $institutionInfo['ins_content']}{$institutionInfo['ins_content']}{else/}暂无信息{/if}
        </div>

        <div class="card">
            <p>联系人：{$institutionInfo['ins_connect_name']}</p>
        </div>
        <div class="card">
            <p>联系方式：{$institutionInfo['ins_mobile']}</p>
        </div>
        <div class="card">
            <p>详细地址：{$institutionInfo['ins_location']}</p>
        </div>
    </div>
</div>
<!--储存经纬度-->
<input type="hidden" id="longitude" value="-1">
<input type="hidden" id="latitude" value="-1">

<div class="foot_nav">
    <ul>
        <li>
            <a href="/" >
                <img src="/static/index/images/nav1.png"/>
                <p>首页</p>
            </a>
        </li>
        <li class="active">
            <a href="{:url('index/Institution/institutionList')}">
                <img src="/static/index/images/nav2-active.png"/>
                <p>培优</p>
            </a>
        </li>

        <li >
            <a href="{:url('index/Article/goodClassList')}">
                <img src="/static/index/images/nav3.png" style="width: 45px;height: 42px;margin-top: -6px;"/>
                <p>好课</p>
            </a>
        </li>
        <li >
            <a href="{:url('index/Article/goodArticleList')}">
                <img src="/static/index/images/nav4.png"/>
                <p>好文</p>
            </a>
        </li>
        <li>
            <a href="http://wechat.wx.0579bb.com/app/index.php?i=7&c=entry&do=forum&m=meepo_bbs">
                <img src="/static/index/images/nav5.png"/>
                <p>BBS</p>
            </a>
        </li>
    </ul>
</div>

<!--底部结束-->
<script type="text/javascript" src="/static/index/js/zepto.js"></script>
<script type="text/javascript" src="/static/index/js/carousel-image.js"></script>
<script>
    $('.carousel-image').CarouselImage({
        num: $('.carousel-image .carousel-num'),
        repeat: true
    });
</script>
<script type="text/javascript" src="/static/index/js/jquery.min.js"></script>
<script type="text/javascript" src="/static/index/js/common.js"></script>
<script type="text/javascript">
    $("#goodClass").click(function () {
        let url = "{:url('index/Article/goodClassList')}?ins_id={$institutionInfo['ins_id']}";
        window.location.href = url;
    })

    $("#insUrl").click(function(){
        let url='{$institutionInfo["ins_url"]}';
        window.location.href=url;
    });
    $("#ins_student_url").click(function(){
        let url='{$institutionInfo["ins_student_url"]}';
        window.location.href=url;
    });
</script>

<script type="text/javascript">
    $(function () {
        //配置微信参数获取坐标
        wx.config({$SDKParams});
        wx.ready(function () {
            // config信息验证后会执行ready方法，所有接口调用都必须在config接口获得结果之后，config是一个客户端的异步操作，所以如果需要在页面加载时就调用相关接口，则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口，则可以直接调用，不需要放在ready函数中。
            $("#map").click(function () {
                wx.openLocation({
                    latitude: {$latitude}, // 纬度，浮点数，范围为90 ~ -90
                    longitude: {$longitude}, // 经度，浮点数，范围为180 ~ -180。
                    name: "{$institutionInfo['ins_name']}", // 位置名
                    address: '', // 地址详情说明
                    scale: 12, // 地图缩放级别,整形值,范围从1~28。默认为最大
                    infoUrl: '' // 在查看位置界面底部显示的超链接,可点击跳转
                });
            });


            //用户分享
            wx.updateAppMessageShareData({
                title: '{$institutionInfo["ins_name"]}', // 分享标题
                desc: '{$institutionInfo["desc"]}', // 分享描述
                link: '{$institutionInfo["url"]}', // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
                imgUrl: '{$institutionInfo["imageUrl"]}', // 分享图标
                success: function () {
                    // 设置成功
                    console.log("分享成功");
                }
            })
        });
    })
</script>
</body>
</html>
